<template>
  <div class="dashboard-container driver-detail">
    <!-- 头部基本信息和驾驶证信息 -->
    <div class="app-container fen">
      <div class="aside-box">
        <div class="el-aside">
          <div
            class="aside-item "
            :class="{active: isActive}"
            @click="tableBtn1"
          >基本信息</div>
          <div
            class="aside-item"
            :class="{active: !isActive}"
            @click="tableBtn2"
          >驾驶证信息</div>
        </div>
      </div>
      <!-- 动态组件切换 -->
      <keep-alive>
        <component :is="componentId"></component>
      </keep-alive>
    </div>
  </div>
</template>
<script>
import driverInfoVue from './components/driver-info.vue'
import driverLicenseVue from './components/driver-license.vue'
export default {
  components: {
    driverInfoVue,
    driverLicenseVue
  },
  data() {
    return {
      isActive: true,
      componentId: 'driverInfoVue'
    }
  },
  methods: {
    tableBtn1() {
      this.isActive = !this.isActive
      this.componentId = 'driverInfoVue'
    },
    tableBtn2() {
      this.isActive = !this.isActive
      this.componentId = 'driverLicenseVue'
    }
  }
}
</script>
<style lang="scss" scoped>
.active {
  color: #ff643d;
}
</style>

<style lang="scss" scoped>
.driver-detail {
    /deep/ .el-container{
    flex-direction: column;
    margin-left: 0px;

  }
  .in{
    height: calc(100vh - 205px);
  }
  .aside-box {
    background: #ffffff;
    border-radius: 4px;
    padding: 24px 37px 24px 37px;
    box-sizing: border-box;
    /deep/ .el-aside {
      padding-bottom: 14px;
      width: 100%!important;
      display: flex;
      background-color: #ffffff;
      border-bottom:1px solid #E5E7EC ;
      text-align: left;
      font-size: 14px;
      .aside-item {
        cursor: pointer;
        &:first-child {
          margin-right: 53px;
          padding-left: 25px;

        }
      }
      .aside-item.active{
        font-size: 16px;
        font-weight: bold;
        color: #20232A;
        &:after{
          content: '';
          display: block;
          background-color:#E15536 ;
          height: 3px;
          width: 49px;
          margin: 0 auto;
          position: relative;
          top: 14px;
        }
      }
      .fen {
        height: 100%;
      }
    }
  }
}
</style>
